<?php foreach ($cases as $key => $case):?>
    <?php
        $class = 'case-list3c';
        if ($key%3 == 0) {
            $class = 'case-list3c-left';
        } else if ($key %3 == 2) {
            $class = 'case-list3c-right'; 
        }
    ?>
        <div class="case-list <?php echo $class?>">
        <?php 
            echo $this->Html->link(
                $this->Html->image('/'.$case['Case']['list_img'], array('width'=>'300','height'=>'180','alt'=>$case['Case']['title'])),
                "/case/view/{$case['Case']['id']}/type:$caseType",
                array('escape' => false, 'title'=>$case['Case']['title'])
            );?>
        <h3><?php echo $this->Html->link($case['Case']['title'], "/case/view/{$case['Case']['id']}/type:$caseType");?></h3>
        <p class="case_tag">Tags: <?php
        $links = array();
        if (isset($case['Case']['tags'])) {
            foreach($case['Case']['tags'] as $tagId) {
                $links[] = $this->Html->link($tagList[$tagId], "/case/tag/{$tagId}");
                //$links[] = $tagList[$tagId];
            }
            echo join(" , ", $links);
        }
        ?></p>
    </div>  
<?php endforeach;?>
